package model;

import java.util.List;

import model.auxillary.Parameter;
import model.auxillary.ParameterCollection;
import model.auxillary.ParameterList;
import model.auxillary.ParameterList.ParameterType;

public interface IManufacturingMethod extends ICalculatableProcess {
    
	/**
     * To get the name of this manufacturing method.
     * @return name of manufacturing method
     */
    public String getName();
    
    /**
     * To get all parameters of this manufacturing method.
     * @return
     */
    public ParameterList getParameters();
    
    /**
     * To set an identifying name for this manufacturing method.
     * @param name name of this manufacturing method.
     */
    public void setName(String name);
    
    /**
     * To get the sub type of manufacturing method.
     * @return sub type of manufacturing method.
     */
    public SubType getSubType();
    
    /**
     * To get the super type of manufacturing method.
     * @return super type of manufacturing method.
     */
    public SuperType getSuperType();
        
    /**
     * To get a specific parameter.
     * @param paramID identification of parameter to retrieve. 
     * @return the parameter.
     */
    public Parameter getParameter(String paramID);    
    
    /**
     * To get the number of part processes of this {@code ManufacturingMethod}.
     * @return number of part processes set.
     */
    public int getPartProCount();
    
    /**
     * To get the maximum allowed number of part processes of this
     * this {@code ManufacturingMethod}.
     * @return maximum allowed number of part processes.
     */
    public int getMaxPartProcesses();
    
    /**
     * To add a new part process to this {@code ManufacturingMethod}.
     * @throws IndexOutOfBoundsException when maximum number of part processes
     * to be added is reached.
     * @return the parameters of the newly created part process.
     */
    public ParameterList addPartProcess() throws IndexOutOfBoundsException;
    
    /**
     * To remove a part process from this {@code ManufacturingMethod}.
     * @throws IndexOutOfBoundsException when trying to remove the last part
     * process.
     */
    public void removePartProcess() throws IndexOutOfBoundsException;    
    
    /**
     * This enum class holds all available manufacturing methods by
     * <b>DIN 8580</b>.
     * @author Oliver Eckstein
     *
     */
    public enum SubType {
    	// #changeIfNewManuMethod
        TURNING,
        DRILLING,
        MILLING,
        INT_FIT_GIVEN_INTERFERENCE,
        CIRCUIT_BOARD_ASSEMBLY,
        SOLDER_PASTE_PRINTING,
        REFLOW_SOLDERING,
        APPLY_ADHESIVES,
        CURING_CONDUCTIVE_ADHESIVES,
        SCREWING,
        LINEAR_WINDING,
        NEEDLE_WINDING,
        LASER_CUTTING_WELDING,
        ARC_WELDING
    }
    
    /**
     * This enum class holds all super types of manufacturing methods by
     * <b>DIN 8580</b>.
     * @author Oliver Eckstein
     *
     */
    public enum SuperType {
    	// #changeIfNewManuMethod
        MANUFACTURING_GEOMETRICALLY_DEFINED_EDGES
    }
    
    /**
     * To get the unique ID of this {@code Manufacturing Method}.
     * @return the unique ID.
     */
    public String getID();
    
    /**
     * To get the physical minimum energy consumption of this 
     * {@code ManufacturingMethod}.
     * @return the physical minimum energy consumption
     * <b>E<sub>min,phy</sub></b> [Wh].
     */
    public double getPhyMinEnergy();
    
    /**
     * To get the technological minimum energy consumption of this 
     * {@code ManufacturingMethod}.
     * @return the technological minimum energy consumption
     * <b>E<sub>min,real</sub></b> [Wh].
     */
    public double getTechMinEnergy();
    
    /**
     * To get the real minimum energy consumption of this 
     * {@code ManufacturingMethod}.
     * @return the real minimum energy consumption
     * <b>E<sub>min,real</sub></b> [Wh].
     */
    public double getRealMinEnergy();
    
    /**
     * To get the measured energy consumption of this manufacturing method.
     * @return the measured energy consumption <b>E<sub>ist</sub></b>.     
     */
    public double getMeasuredEnergy();
    
    /**
     * To get the number of processes needed for the manufacturing of one unit
     * of the product. (= N_ProzessProdukt)
     * @return the number of processes <b>N<sub>Prozess,Produkt</sub></b>
     */
    public double getNumberOfProcess();
    
    /**
     * To get the rate of the process at which products are produced correctly.
     * @return the rate <b>GR<sub>Prozess</sub></b>
     */
    public double getGutteilrateProzess();
    
    /**
     * To get the process specific degree of utilization of compressed air.
     * @return <b>&phi;<sub>Prozess</sub></b>
     */
    public double getPhiProzess();
    
    /**
     * To get all parameters of same type.
     * @param type the parameters' type.
     * @return the parameters.
     */
    public List<ParameterCollection> getParameters(ParameterType type);
    
    /**
     * To get a specific part process of this {@code ManufacturingMethod}.
     * @param partProcessID the ID of the part process.
     * @return the part process.
     */
    public PartProcess getPartProcess(String partProcessID);
    
   /**
     * To add a tool to this {@code ManufacturingMethod}.
     * @return the parameters of the added tool.
     */
    public ParameterCollection addTool();
    
    /**
     * To remove the last tool from this {@code ManufacturingMethod}.
     */
    public void removeTool(); 
    
    /**
	 * To get all input parameter types.
	 * @return the parameter types.
	 */
    public ParameterType[] getInputParameterTypes();
    
}
